package over;

public class GraphBuilder extends ListGraph{
    private static final Graph graph = new ListGraph();

    public static Edge edge() {
        return new Edge(graph);
    }
}

class Edge extends GraphBuilder{
    private Graph graph;
    private String from;
    private String to;

    public Edge(Graph graph) {
        this.graph = graph;
    }

    public Edge from(String from) {
        this.from = from;
        graph.addNode(from);
        return this;
    }

    public Edge to(String to) {
        this.to = to;
        graph.addNode(to);
        graph.addEdge(this.from, this.to);
        return this;
    }
}
